package org.example.examfx02.tool;

import com.fasterxml.jackson.core.type.TypeReference;
import org.example.examfx02.entity.*;

import java.util.List;

public class ReadFile {
    private static final String STU_FILE = "data/Student.json";
    private static final String TEA_FILE = "data/Teacher.json";
    private static final String COURSE_FILE = "data/Course.json";
    private static final String SC_FILE = "data/SelectCourse.json";
    public static List<Student> readStuFile(){
            return JsonFileUtil.readJsonFile(STU_FILE, new TypeReference<List<Student>>() {});
    }
    // 教师数据读取
    public static List<Teacher> readTeaFile() {
        return JsonFileUtil.readJsonFile(TEA_FILE, new TypeReference<List<Teacher>>() {});
    }

    // 课程数据读取
    public static List<Course> readCourseFile() {
        return JsonFileUtil.readJsonFile(COURSE_FILE, new TypeReference<List<Course>>() {});
    }

    // 选课数据读取
    public static List<SelectCourse> readSCFile() {
        return JsonFileUtil.readJsonFile(SC_FILE, new TypeReference<List<SelectCourse>>() {});
    }
}
